package com.hnust.api;

import com.hnust.domain.GroupInfo;
import com.hnust.domain.Result;
import com.hnust.domain.UpdateInfoReqBody;
import com.hnust.domain.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(
        name = "personalDataApis",
        url = "${feign.baseUrl}"
)
public interface PersonalDataApis {
    //获取老师个人信息
    @GetMapping("/api/teacher/getInfo")
   Result<UserInfo> getInfo(@RequestParam("teacherId") String id);

    //修改老师个人信息
    @PostMapping("/api/teacher/updateInfo")
    Result<String> updateUserInfo(@RequestBody UpdateInfoReqBody updateInfoReqBody);

    //申请加入课程组
    @PostMapping("/api/teacher/applyCourse")
    Result<Boolean> applyCourseGroup(@RequestParam("teacherId") String id,
                          @RequestParam("groupId") String groupId);

    //获取所有课程组
    @GetMapping("/api/teacher/getCourseGroup")
    Result<List<GroupInfo>> getCourseGroup(@RequestParam("collegeId") String collegeId);

    //退出课程组
    @PostMapping("/api/teacher/outCourse")
    Result<Boolean> outCourse(@RequestParam("teacherId") String id,
                      @RequestParam("courseGroupId") String groupId);

    //获取老师正在等待审核的课程组
    @GetMapping("/api/teacher/getWaitCourseGroup")
    Result<List<GroupInfo>> getWaitCourseGroup(@RequestParam("teacherId") String id);

}
